import { axios } from '@/utils/request'

//课程
export function coursesList(params) {
  return axios({
    url: '/school/courses',
    method: 'post',
    data: params
  })
}
export function courseCreate(params) {
  return axios({
    url: '/school/courses/create',
    method: 'post',
    data: params
  })
}
export function courseInfo(id) {
  return axios({
    url: '/school/courses/' + id,
    method: 'post',
    data: { include: 'coursePrice' }
  })
}
export function courseEdit(params, id) {
  return axios({
    url: '/school/courses/' + id + '/update',
    method: 'post',
    data: params
  })
}
export function coursesDel(id) {
  return axios({
    url: '/school/courses/' + id + '/delete',
    method: 'post'
  })
}
export function changeCoursesType(params, id) {
  return axios({
    url: '/school/courses/' + id + '/enable-status',
    method: 'post',
    data: params
  })
}
export function newCoursesList(params) {
  return axios({
    url: '/school/students/course-list',
    method: 'post',
    data: params
  })
}
//物品
export function itemList(params) {
  return axios({
    url: '/school/goods',
    method: 'post',
    data: params
  })
}
export function itemCreate(params) {
  return axios({
    url: '/school/goods/create',
    method: 'post',
    data: params
  })
}
export function itemAddNum(params) {
  return axios({
    url: '/school/goods/add-stock',
    method: 'post',
    data: params
  })
}
export function itemStockList(params,id) {
  return axios({
    url: '/school/goods/'+id+'/stock-history-list',
    method: 'post',
    data: params
  })
}
export function itemEdit(params, id) {
  return axios({
    url: '/school/goods/' + id + '/update',
    method: 'post',
    data: params
  })
}
export function changeItemType(params, id) {
  return axios({
    url: '/school/goods/' + id + '/enable-status',
    method: 'post',
    data: params
  })
}
export function itemDel(id) {
  return axios({
    url: '/school/goods/' + id + '/delete',
    method: 'post'
  })
}


//费用
export function costList(params) {
  return axios({
    url: '/school/costs',
    method: 'post',
    data: params
  })
}
export function costCreate(params) {
  return axios({
    url: '/school/costs/create',
    method: 'post',
    data: params
  })
}
export function costEdit(params, id) {
  return axios({
    url: '/school/costs/' + id + '/update',
    method: 'post',
    data: params
  })
}
export function changeCostType(params, id) {
  return axios({
    url: '/school/costs/' + id + '/enable-status',
    method: 'post',
    data: params
  })
}
export function costDel(id) {
  return axios({
    url: '/school/costs/' + id + '/delete',
    method: 'post'
  })
}
// /costs/create
//套餐
export function comboList(params) {
  return axios({
    url: '/school/set-meals',
    method: 'post',
    data: params
  })
}
export function changeComboType(params, id) {
  return axios({
    url: '/school/set-meals/' + id + '/enable-status',
    method: 'post',
    data: params
  })
}
export function comboDel(id) {
  return axios({
    url: '/school/set-meals/' + id + '/delete',
    method: 'post'
  })
}